from typing import *
from leetcode.editor.common.node import *


# leetcode submit region begin(Prohibit modification and deletion)
class Solution:
    def firstUniqChar(self, s: str) -> int:
        code = [0] *26
        for c in s:
            code[ord(c)-ord('a')] += 1
        for index,c in enumerate(s):
            if code[ord(c)-ord('a')] == 1:
                return index
        return -1

# leetcode submit region end(Prohibit modification and deletion)


if __name__ == '__main__':
    solution = Solution()
    # your test code here